Skip to content

feat(vault): migrate market/proposals/witnesses callers to useSessionSigning (A6-T4) - #397

Merged
ety001 merged 2 commits into
next-devfrom
feat/a6-t4-market-proposals-witness
Nov 21, 2026
Merged

ety001 merged 2 commits into
next-devfrom
feat/a6-t4-market-proposals-witness

Conversation

@ety001

@ety001 ety001 commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Part of #381

Summary

A6-T4 — the LAST migration PR: moves the final five business signing callers onto the unified useSessionSigning() entry and closes the documented market/proposals login-dialog UX gap. Vault identity sessions now sign market limit orders, proposals votes / create / remove and witness vote / proxy through the per-key password dialog (no re-login loop); privateKey behavior is preserved exactly apart from the disclosed first-login tightening below. Operation tuples are byte-identical to the retired SteemSigner.* builders; broadcast routes and payloads unchanged.

Per-caller role floors and classifier state (all verified against the current key resolution — every op here was already in OPERATION_AUTHORITY_CLASSES, so the classifier needed NO code changes, only new pins):

  • market-page-client — limit_order_create / limit_order_cancel at the active floor (table entries; same active→owner resolution the previous useActiveSigningKey gave). Tuple pins cover field order, fill_or_kill: false, the ISO expiration conversion (unixSecToSteemIsoTimestamp — condenser_api expects time_point_sec, not unix seconds) and uint32 orderid range.
  • proposals-page-client — update_proposal_votes at the active floor. Deviation from the task hint ("posting class"): update_proposal_votes is an ACTIVE-class Steem operation — three agreeing sources: the classifier table (in place since A4 feat(vault): manager, signer and unified signing facade (A4) #389), the legacy postingOps whitelist (vote, comment, delete_comment, custom_json, claim_reward_balance — proposal votes absent, so legacy signed them with the active key), and the pre-T4 caller itself (useActiveSigningKey = active→owner). A posting floor would have silently CHANGED privateKey key resolution; 'active' preserves it exactly.
  • proposal-creator-dialog — create_proposal at the active floor (table entry; normalized creator/receiver kept, pinned).
  • proposal-remove-dialog — remove_proposal at the active floor (table entry; proposal_owner normalization kept, pinned).
  • witness-vote-form — account_witness_vote / account_witness_proxy at the active floor (table entries). The pre-A6 signingKeyRef gate is gone: an authenticated vault session votes through the password path instead of re-opening a login dialog, and the login dialog's conditional fixedUsername — the last business reachability of the vaultUnsupported* notice — is retired (pinned: vault session → action completes, zero LoginForm mounts).

Login-dialog decisions (the documented gap closure)

  • All three page-level sign-in dialogs (market / proposals / witnesses) now pass requiredAuthTypes: ['active'] — derived from each dialog's actions: every action on these pages is active-class (order place/cancel, vote, create, remove, witness vote, proxy). This is a deliberate privateKey UX tightening, disclosed per the documented gap: a posting-only privateKey login that previously "succeeded" and then looped (action → no key → dialog reopened) is now rejected up front with insufficientAuthority. Proposals asks for active, NOT the task-hinted posting, because its ops are active-class — ['posting'] would re-open the exact loop the gap closure removes.
  • No fixedUsername on these dialogs: they are session-account pages; the dialogs open only for unauthenticated visitors who may log in as any account. Each caller's needsClassicReauth surface is a separate account-locked re-auth dialog (fixedUsername + ['active']), matching the delegate/transfer pattern.
  • LoginForm dispatcher narrowing: requiredAuthTypes ALONE no longer triggers the vaultUnsupported* notice — Vault Mode keeps identity selection there and the per-action password dialog enforces the floor after login ("the real path ... that A6 wires" from the T2 comment). The notice remains for account-pinned (fixedUsername) re-auth — identity selection would switch accounts — so every existing consumer (which all pass both props) is unchanged; the permissions key-reveal notice stays permanently. Pinned in login-form-dispatch.test.tsx and by the t4 suite's dialog-propagation tests.

Implementation notes

  • privateKey path: no pre-check, no extra calls, runtime-independent — the hook's static legacy signer resolves active→owner exactly like useActiveSigningKey did; keyless sessions get needsClassicReauth → the classic re-auth dialog (per caller: market, proposals page, creator dialog, remove dialog, witness form each own one).
  • Vault path: password dialog per action; wrong-password retry in-dialog (dialog's own contract); the hook's identity assertion applies (these are all session-account actions).
  • The witness form's pendingAction replay effect drops its signingKeyRef condition (fires on authenticated session; a keyless privateKey replay ends in the re-auth dialog rather than silently doing nothing — a small improvement over the old behavior where the replay quietly never ran for a posting-only login).
  • Final SteemSigner inventory (no business callers remain — cleanup of the retired builders is a separate decision, NOT done here):
    • Broadcast-bound signing: login-form.tsx signChallenge (login challenge, permanent); recover-account-confirmation-page.tsx signRecoverAccount (dual old+new owner signatures, invariant 20, permanent); claim-rewards-banner.tsx signClaimRewardBalance (device-remembered posting-key branch — key exists in no session); communities-section.tsx signOperations (hivemind setup ops with the new community owner's freshly derived key — exists in no session).
    • Non-signing helpers (derive/validate only, never broadcast): login-form.tsx (derive/privateKeyToPublicKey/isValid/verify), recover-account-step-1-page.tsx, recover-account-confirmation-page.tsx, account-keys.ts, change-password.ts, claim-rewards-banner.tsx (verifyPrivateKey).
    • Retired with ZERO production callers: signLimitOrderCreate, signLimitOrderCancel, signUpdateProposalVotes, signCreateProposal, signRemoveProposal, signWitnessVote, signWitnessProxy (this PR), plus the T2/T3a/T3b batch (signTransfer, signDelegate, signPowerDown, signTransferToVesting, signConvert, signSetWithdrawVestingRoute, signCancelTransferFromSavings, signAccountUpdate, signAccountCreate, signChangeRecoveryAccount).
  • Docs: 09-vault.md — "Known UX gaps" block rewritten (none left for vault sessions; permissions key-reveal notice permanent), module map + invariant-21 consequences + R3-decisions notice semantics + the A6 progress block now states the COMPLETE caller migration with the final who-still-signs-directly inventory; 02-auth.md — signing-entry inventory, the update_proposal_votes authority note and the login-dialog contract; 06-frontend.md — key-selection rule status.
  • i18n: ZERO new keys (re-auth dialogs reuse wallet.reauthTitle/reauthDescription, all four locales).

Test plan

  • pnpm verify green (type-check + lint — 0 errors, 3 warnings: the exhaustive-deps warning is pre-existing but its file (login-form.tsx) IS touched by this PR (the dispatcher comment rewrite moved its line 178→187); the other two warnings are in untouched files — plus 153 files / 1681 unit tests + coverage 83.99% stmts / 75.9% branches / 86.25% lines + build).
  • New tests/unit/wallet-t4-session-signing.test.tsx: 5 callers × 3 session shapes (privateKey-with-key signs the byte-identical tuple at the active floor; vault session completes with zero LoginForm mounts; keyless privateKey → account-locked re-auth with fixedUsername + ['active']) + tuple pins for all seven ops + dialog-propagation pins (market/proposals/witnesses sign-in dialogs: ['active'], no fixedUsername) + the witness notice-retirement pin.
  • Reworked onto the hook boundary: market-page-client.test.tsx (G-7/G-14 orderid pins preserved), proposals-page-vote.test.tsx (optimistic flip K-3 preserved), proposal-creator-dialog.test.tsx, proposal-remove-dialog.test.tsx (normalization pins preserved).
  • login-form-dispatch.test.tsx: requiredAuthTypes-alone now pins identity selection; fixedUsername notice case unchanged. vault-signer.test.ts: classifier pins for all seven T4 shapes.
  • pnpm e2e green — 20/20, including the new vault-session proposals-vote flow in vault-session-signing.spec.ts (SPA navigation via the side panel, active-floor dialog offers only the active-stored key, byte-identical update_proposal_votes tuple broadcast, zero /api/auth/* traffic).

Not verified or known limits

  • The market / creator / remove / witness vault flows are unit- and hook-matrix-tested; only the proposals vote got a dedicated browser e2e (per the "ONE e2e" scope — chosen over witness vote because it also pins the update_proposal_votes active-floor decision end-to-end).
  • A posting-only privateKey session on these pages now hits the explicit re-auth dialog at ACTION time (before T4 the pages hid the actions entirely via the useActiveSigningKey gate) — same shape as the T3a wallet forms; flagged as behavior-visible.
  • A vault session whose vault holds no key at-or-above active sees the signing dialog's existing no-keys notice + vault-management shortcut (no new copy).
  • The retired SteemSigner builders are left in place intentionally (per task instructions); deleting them is a separate orchestrator decision recorded in the inventory above.

…Signing (A6-T4)

Migrates the last five business signing callers onto the unified
useSessionSigning entry and closes the market/proposals login-dialog UX gap,
completing the A6 caller migration.

- Callers: market-page-client (limit_order_create / limit_order_cancel),
  proposals-page-client (update_proposal_votes), proposal-creator-dialog
  (create_proposal), proposal-remove-dialog (remove_proposal),
  witness-vote-form (account_witness_vote / account_witness_proxy).
  Operation tuples are byte-identical to the retired SteemSigner builders
  (including the limit_order_create ISO expiration conversion); broadcast
  routes/payloads unchanged; privateKey behavior unchanged apart from the
  disclosed dialog tightening below.
- All seven call sites sign at the ACTIVE floor. update_proposal_votes is
  active-class on Steem (the legacy postingOps whitelist never listed it;
  the pre-T4 caller signed with the active-or-owner key) - the classifier
  table already classified all five op types; new pin tests guard them.
- UX gap closure: the market/proposals/witnesses sign-in dialogs now pass
  requiredAuthTypes ['active'] with no fixedUsername (session-account
  pages), so a privateKey login is fit for purpose the first time. The
  LoginForm dispatcher no longer shows the vaultUnsupported notice for
  requiredAuthTypes alone - identity selection stays available in Vault
  Mode and the per-action password dialog enforces the floor after login;
  the notice remains for account-pinned (fixedUsername) re-auth. The
  witness login dialog's conditional fixedUsername (the last business
  notice reachability) is retired.
- Vault identity sessions get every action on the three pages through the
  per-key password dialog (action gates widen to authenticated-session);
  keyless privateKey sessions get the classic account-locked re-auth
  dialog per caller (needsClassicReauth).
- Docs: 09-vault.md (known UX gaps none left except the permanent
  permissions key-reveal notice; final who-still-signs-directly
  inventory), 02-auth.md, 06-frontend.md.
- Tests: new wallet-t4-session-signing suite (5 callers x 3 session shapes
  + tuple pins + dialog propagation + witness notice retirement),
  reworked caller suites onto the hook boundary, dispatcher narrowing pin,
  classifier pins, and a vault-session proposals-vote e2e (exact broadcast
  tuple, zero /api/auth/* traffic).
- 06-frontend.md: disambiguate the T4 floor phrasing — 'each of the five
  T4 callers at the ACTIVE floor', with the earlier callers' posting/owner
  floors referenced as the documented exceptions (mirrors 02-auth.md).
- wallet-t4-session-signing: pin the re-auth dialog props (fixedUsername +
  requiredAuthTypes ['active']) in the remove-dialog keyless test, matching
  the create-dialog's test.
- PR body: the lint warning note now states the exhaustive-deps warning's
  file (login-form.tsx) is touched by this PR (line moved 178->187).
@ety001
ety001 merged commit d009bb2 into next-dev Nov 21, 2026
2 of 3 checks passed
@ety001
ety001 deleted the feat/a6-t4-market-proposals-witness branch November 21, 2026 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant